package cn.allinmd.indi.applymodelxian.model.authenticate.entity;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

import cn.bmob.v3.BmobObject;

/**
 * @author: XianXueLiang
 * @date: 2016/6/17
 */
public class User extends BmobObject implements Parcelable{
    private String objectid;
    private String username;
    private String password;
    private boolean mobilePhoneNumberVerified;
    private String mobilePhoneNumber;
    private boolean emailVerified;
    private String email;

    public User(){
    }

    protected User(Parcel in) {
        objectid = in.readString();
        username = in.readString();
        password = in.readString();
        mobilePhoneNumber = in.readString();
        email = in.readString();
        Bundle bundle = in.readBundle(getClass().getClassLoader());
        mobilePhoneNumberVerified = bundle.getBoolean("mobilePhoneNumberVerified");
        emailVerified = bundle.getBoolean("emailVerified");
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(objectid);
        dest.writeString(username);
        dest.writeString(password);
        dest.writeString(mobilePhoneNumber);
        dest.writeString(email);
        Bundle bundle = new Bundle();
        bundle.putBoolean("mobilePhoneNumberVerified",mobilePhoneNumberVerified);
        bundle.putBoolean("emailVerified",emailVerified);
        dest.writeBundle(bundle);
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", mobilePhoneNumberVerified=" + mobilePhoneNumberVerified +
                ", mobilePhoneNumber='" + mobilePhoneNumber + '\'' +
                ", emailVerified=" + emailVerified +
                ", email='" + email + '\'' +
                '}';
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Boolean getMobilePhoneNumberVerified() {
        return mobilePhoneNumberVerified;
    }

    public void setMobilePhoneNumberVerified(Boolean mobilePhoneNumberVerified) {
        this.mobilePhoneNumberVerified = mobilePhoneNumberVerified;
    }

    public String getMobilePhoneNumber() {
        return mobilePhoneNumber;
    }

    public void setMobilePhoneNumber(String mobilePhoneNumber) {
        this.mobilePhoneNumber = mobilePhoneNumber;
    }

    public Boolean getEmailVerified() {
        return emailVerified;
    }

    public void setEmailVerified(Boolean emailVerified) {
        this.emailVerified = emailVerified;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
